﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/PageMaster.Master" Inherits="System.Web.Mvc.ViewPage<PagedList<GrupyzServices.BdAccess.ComentarioViewModel>>" %>
	<%@ Import Namespace="RPX.Web.MVC.Extensions"%>
	<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Comentários
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="barralateral" runat="server">
	<!--SideDeal-->
	<div class="cb">
		<div class="bt">
			<div>
			</div>
		</div>
		<div class="i1">
			<div class="i2">
				<div class="i3">
					<h3 style="text-align: center; color: rgb(29, 129, 193); font-weight: bold; border-bottom: 1px solid rgb(122, 204, 246);
						margin-bottom: 7px;">
						Negócio</h3>
					<% Html.RenderAction("SideDealComentario", "Deal", new { id = ViewData["DealId"] }); %>
				</div>
			</div>
		</div>
	</div>
	<div class="bb">
		<div>
		</div>
	</div>
	<!--SideDeal-->
	<!--Parceiros-->
		<% Html.RenderPartial("LateralNegocioConhecido"); %>
	<!--Parceiros-->
	<!--Comerciais-->
		<% Html.RenderPartial("LateralComerciais"); %>
	<!--Comerciais-->
	<!--Facebook-->
	<% Html.RenderPartial("LateralFacebook"); %>
	<!--Facebook-->
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<script type="text/javascript">
		$(document).ready(function () {
			$("form").submit(function () {
				if ($("#Texto").val() == "" || $("#Texto").val() == null)
					return false;
				else
					return true;
			});
		});
	</script>
	<h5 class="titulo">
		Comentários</h5>
	<ul class="hfeed">
	<% if (Model.Count() == 0)
	   { %>
	   <h5>Ainda não existem comentários. Seja o primeiro a comentar!</h5>
		<% } foreach (var item in Model)
		   { %>
		<li class="quote hentry">
			<div class="activity">
				<p class="author vcard">
					<%: item.NomeCliente %>
					<%: Html.Image(item.Imagem, new { width = "48", height = "48", @class = "imgComment" })%>
					<span class="caixaImg"></span>comentou:<span style="float: right"><%: item.Data.ToLocalTime() %></span>
				</p>
				<blockquote class="entry-content">
					<p>
						<%: item.Texto %>
					</p>
				</blockquote>
				<span class="b"></span>
			</div>
		</li>
		<% } %>
	</ul>
	<%=Html.Pager(Model, new PagerOptions {
	PrevPageText = "&lt",
	NextPageText = "&gt;",
	AlwaysShowFirstLastPageNumber = true,
	HorizontalAlign = "right",
	FirstPageText = "&lt;&lt;",
	LastPageText = "&gt;&gt;",
	PageIndexParameterName = "pag"},
	new { style = "width: 100%; text-align: right; float: right; padding-right: 16px; margin-top: 20px;" })%>
	
	<div class="clear">
	</div>
	<%
		if (Request.IsAuthenticated)
		{
			using (Html.BeginForm())
			{
	%>
	<%: Html.Hidden("ClienteId", Page.User.Identity.Name) %>
	<%: Html.Hidden("DealId", ViewData["DealId"]) %>
	<p>
		<%: Html.TextArea("Texto", new { style = "width:77%;height:50px;margin-top:25px;margin-bottom:-10px;" })%>
	</p>
	<p>
		<input type="submit" class="btn blue" value="Enviar comentário" id="btnSub" />
	</p>
	<div class="clear">
	</div>
	<%
		}
		}
		else
		{
	%>
	<h5>Precisa de fazer [
	<%: Html.ActionLink("Login", "LogOn", "Account") %>
	] para comentar!</h5>
	<%
		}
	%>
</asp:Content>
